package com.corpgovernment.common.enums;

import java.util.Arrays;

public enum DeliveryTypeEnum {

    CJS("CJS", "定期配送"),
    PJS("PJS", "快递"),
    PJN("PJN", "无需配送");

    private String code;
    private String desc;

    DeliveryTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static DeliveryTypeEnum getByCode(String code) {
        return Arrays.stream(DeliveryTypeEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
    }
}
